package oo;

class Fish{
	int weight;
}
class Lake{
	Fish fish;
	void setFish(Fish s){
		fish = s;
	}
	void eat(int n){
		fish.weight = fish.weight + n;
	}
}


public class FishandLake{
	public static void main(String[] args) {
		Fish niqiu = new Fish();
		System.out.println("泥鳅："+niqiu.weight);//输出1
		Lake taihu  = new Lake();
		taihu.setFish(niqiu);
		taihu.eat(10);
		System.out.println("泥鳅："+ niqiu.weight);//输出2
		System.out.println("台湖里的泥鳅：" + taihu.fish.weight);//输出3
		Lake lake1 = new Lake();
	    lake1.setFish(niqiu);
	    lake1.eat(233);
	    System.out.println("泥鳅：" + niqiu.weight);
	    System.out.println("湖1里的泥鳅：" +lake1.fish.weight);
	    System.out.println("台湖里的泥鳅：" +taihu.fish.weight);
	}
}
